package com.ctshk.sapp.order.scenic.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.model.PageResponse;
import com.ctshk.rpc.order.scenic.dto.ScenicOrderDTO;
import com.ctshk.rpc.order.scenic.dto.ScenicOrderTouristDTO;
import com.ctshk.rpc.order.scenic.req.ScenicOrderReq;
import com.ctshk.rpc.order.scenic.req.ScenicOrderTouristModifyReq;
import com.ctshk.rpc.order.scenic.req.ScenicOrderTouristReq;
import com.ctshk.rpc.order.scenic.service.IScenicOrderTouristService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.ctshk.common.web.support.BaseController;

import java.util.List;

/**
 * <p>
 * 门票订单旅客信息 前端控制器
 * </p>
 *
 * @author 张志朋
 * @since 2021-02-24
 */
@Api(value="门票订单旅客信息", tags="门票订单旅客信息")
@RestController
@RequestMapping("/scenic/order/tourist")
public class ScenicOrderTouristController extends BaseController {

    @DubboReference
    private IScenicOrderTouristService iScenicOrderTouristService;

    @ApiOperation(value = "订单中心旅客列表", notes = "订单中心旅客列表(陈雷)")
    @OperationLogAnnotation(operModul = OperationLogModel.TICKET, operType = OperationLogType.QUERY, operTitle = "订单中心旅客列表", operDesc = "订单中心旅客列表")
    @PostMapping(value = "/list")
    public Result<List<ScenicOrderTouristDTO>> list(@RequestBody ScenicOrderTouristReq scenicOrderTouristReq){
        return iScenicOrderTouristService.list(scenicOrderTouristReq,getCurrentUser(getRequest()));
    }

    @ApiOperation(value = "修改旅客信息", notes = "修改旅客信息(陈雷)")
    @OperationLogAnnotation(operModul = OperationLogModel.TICKET, operType = OperationLogType.UPDATE, operTitle = "修改旅客信息", operDesc = "修改旅客信息")
    @PostMapping(value = "/modify")
    public Result<List<ScenicOrderTouristDTO>> modify(@RequestBody ScenicOrderTouristModifyReq scenicOrderTouristModifyReq){
        return iScenicOrderTouristService.modify(scenicOrderTouristModifyReq,getCurrentUser(getRequest()));
    }
}
